package com.lingyin.jsonlib.test.domain;

import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.io.Serializable;

import com.lingyin.json.JSONUtil;


public class Domain2 implements Serializable
{

    private String a;
    private String b;
    //private String c;
    //private String d;
    //private String e;
    
    public Domain2()
    {
        
    }
    
    public Domain2(String a, String b)//, String c, String d, String e)
    {
        this.a = a;
        this.b = b;
        /*this.c = c;
        this.d = d;
        this.e = e;*/
    }

    
    public String getA()
    {
        return a;
    }

    public void setA(String a)
    {
        this.a = a;
    }

    public String getB()
    {
        return b;
    }

    public void setB(String b)
    {
        this.b = b;
    }
    
//    /**
//     * @return 返回 c
//     */
//    public String getC()
//    {
//        return c;
//    }
//
//    /**
//     * @param c 设置 c
//     */
//    public void setC(String c)
//    {
//        this.c = c;
//    }
//
//    /**
//     * @return 返回 d
//     */
//    public String getD()
//    {
//        return d;
//    }
//
//    /**
//     * @param d 设置 d
//     */
//    public void setD(String d)
//    {
//        this.d = d;
//    }
//
//    /**
//     * @return 返回 e
//     */
//    public String getE()
//    {
//        return e;
//    }
//
//    /**
//     * @param e 设置 e
//     */
//    public void setE(String e)
//    {
//        this.e = e;
//    }

    public String toString()
    {
        return "a:==" + a + ",b:==" + b;
    }
    
    /*public static void main(String[] args)
    {
        try
        {
            int size = 10000000;
            Domain2 d = new Domain2("a", "b", "c", "d", "e");
            long t = System.currentTimeMillis();
            
            for (int i = 0; i < size; i++)
            {
                JSONUtil.toNormalJSONString(d);
            }
            System.out.println("=====json====" + (System.currentTimeMillis() - t));
            String v = JSONUtil.toNormalJSONString(d);
            t = System.currentTimeMillis();
            for (int i = 0; i < size; i++)
            {
                JSONUtil.parseObject(v, Domain2.class);
            }
            System.out.println("=====json=to object===" + (System.currentTimeMillis() - t));
            t = System.currentTimeMillis();
            ObjectOutputStream oos;
            for (int i = 0; i < size; i++)
            {
                oos = new ObjectOutputStream(new PipedOutputStream(new PipedInputStream()));
                oos.writeObject(d);
            }
            System.out.println("=====seri====" + (System.currentTimeMillis() - t));
            PipedInputStream in = new PipedInputStream();
            oos = new ObjectOutputStream(new PipedOutputStream(in));
            oos.writeObject(d);
            byte[] b = new byte[in.available()];
            in.read(b);
            v = new String(b);
            ObjectInputStream ois;            
            t = System.currentTimeMillis();
            for (int i = 0; i < size; i++)
            {                
                ois = new ObjectInputStream(new ByteArrayInputStream(b));
                ois.readObject();
            }
            System.out.println("=====serial=to object===" + (System.currentTimeMillis() - t));
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }*/

}
